package com.rpp.study.dao;

import com.rpp.study.entity.LagouAuthCode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface LagouAuthCodeRepository extends JpaRepository<LagouAuthCode, Integer> {

    @Query(nativeQuery = true,
            value = "select * from lagou_auth_code where email = ?1 and code = ?2 order by createtime desc limit 1")
    LagouAuthCode findLatestOne(String email, String code);
}
